﻿using ManYan.Application.Admin;
using ManYan.Application.Admin.Dto;
using ManYan.Common;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace ManYan.Api.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class AdminController : ControllerBase
    {
        private readonly IAdminAppService _adminAppService;
       public AdminController(IAdminAppService adminAppService)
        {
            _adminAppService = adminAppService;
        }
        [AllowAnonymous]
        // POST api/<AdminController>
        [HttpPost]
        public Res Post([FromForm] AdminLoginDto dto)
        {
            return _adminAppService.AdminLogin(dto.UserName, dto.UserPwd);
        }

       
    }
}
